# encoding: utf-8
"""
RESTful API Redises resources
--------------------------
"""

from flask_restplus import Resource

from app.extensions.api import Namespace
from app.extensions.api.results import *
from app.modules.redises import schemas
from app.modules.redises.models import Redis
from app.modules.redises.pipelines import *

log = logging.getLogger(__name__)  # pylint: disable=invalid-name
api = Namespace('redises', description="The interface for redises operation.")  # pylint: disable=invalid-name


@api.route('/')
class Redises(Resource):
    """
    Manipulations with rediss.
    """
    @api.response(schemas.RedisOperationSchema())
    def get(self):
        """
        List of rediss.

        Returns a list of users starting from ``offset`` limited by ``limit``
        parameter.
        """
        return Redis.query.all()

